package com.cskaoyan.bean.bo.wxorder;

import com.cskaoyan.bean.vo.wxorder.HandleOption;

/**
 * @author Zhang Tao
 * @version 1.0.0
 * @description
 * @date since 2022-07-19 10:43
 */

public class HandleInfo {
    private final static HandleOption handle = new HandleOption();


    public static HandleOption handleOption(Short orderstate) {
        // 待付款
        if (orderstate==101){
            handle.setRebuy(false);
            handle.setDelete(false);
            handle.setAftersale(false);
            handle.setComment(false);
            handle.setCancel(true);
            handle.setPay(true);
            handle.setConfirm(false);
            handle.setRefund(false);
        }
        // 已付款
        if (orderstate==201) {
            handle.setRebuy(false);
            handle.setDelete(false);
            handle.setAftersale(false);
            handle.setComment(false);
            handle.setCancel(false);
            handle.setPay(false);
            handle.setConfirm(false);
            handle.setRefund(true);
        }
        // 已发货
        if (orderstate==301) {
            handle.setConfirm(true);
            handle.setRebuy(false);
            handle.setDelete(false);
            handle.setAftersale(false);
            handle.setCancel(false);
            handle.setComment(false);
            handle.setPay(false);
            handle.setRefund(false);
        }
        // 已收货
        if (orderstate==401 || orderstate==402) {
            handle.setAftersale(true);
            handle.setComment(true);
            handle.setDelete(true);
            handle.setRebuy(true);
            handle.setRefund(false);
            handle.setConfirm(false);
            handle.setCancel(false);
            handle.setPay(false);
        }
        // 订单取消
        if (orderstate==202){
            handle.setRebuy(false);
            handle.setDelete(false);
            handle.setAftersale(false);
            handle.setComment(false);
            handle.setPay(false);
            handle.setCancel(false);
            handle.setConfirm(false);
            handle.setRefund(false);
        }
        // 订单取消、退款成功
        if (orderstate==102||orderstate==103||orderstate==203){
            handle.setRebuy(false);
            handle.setDelete(true);
            handle.setAftersale(false);
            handle.setComment(false);
            handle.setCancel(false);
            handle.setConfirm(false);
            handle.setPay(false);
            handle.setRefund(false);
        }
        return handle;
    }
}
